<?php
$phone	= $_POST['searchstring'];
$view	= $_POST['searchtype'];
$techno	= $_POST['searchtechno'];

if(trim($techno)=="4G"){
	include_once("Vendors/HSS_Online/Classes/Request.php");
	include_once("Vendors/HSS_Online/Classes/Request_HSS.php");
	include_once("Vendors/HSS_Online/Classes/Parse_HSS.php");
	include_once("Vendors/HSS_Online/Classes/Translate_HSS.php");
	$ask	= new Request();
	$res	= $ask->Request_MSISDN($phone);
	if($res['trans']['MSISDN']==""){
		echo "<center>MSIDN no disponible en 4G</center>";
		exit;
	}
}else{
	include_once("Vendors/HLR_Online/Classes/Request.php");
	include_once("Vendors/HLR_Online/Classes/Request_HLR.php");
	$ask	= new Request();
	$res	= $ask->Request_MSISDN($phone,$view);
	if(($res['SUSCRIBER_IDENTITY']['MSISDN']=="")AND($view=="html")){
		echo "<center>MSIDN no disponible en 2G-3G</center>";
		exit;
	}
}
switch($view){
	case "xml":
		echo "<b>Comando SUB:</b><br><pre>";
		print htmlentities($res['orig']['SUB']);
		echo "</pre><b>Comando DYNSUB:</b><br><pre>";
		print htmlentities($res['orig']['DYNSUB']);
		echo "</pre><b>Comando CFALL:</b><br><pre>";
		print htmlentities($res['orig']['CFALL']);
		echo "</pre><b>Comando ECATEGORY:</b><br><pre>";
		print htmlentities($res['orig']['ECATEGORY']);
		echo "</pre><b>Comando CWAIT:</b><br><pre>";
		print htmlentities($res['orig']['CWAIT']);
		echo "</pre><b>Comando OPTGPRS:</b><br><pre>";
		print htmlentities($res['orig']['OPTGPRS']);
		echo "</pre>";
	break;

// Inicio perfil Tecnico

	case "array":
		if($techno=="4G"){

		//			echo "<pre>";
			//var_dump($res);
		//	echo "</pre>";
echo "<pre>";
$salida=array_slice($res,1);
print_r($salida);
//print implode(',',$res);
echo "</pre>";

		}else{
			foreach($res AS $line){

				echo $line."<br>"."\r\n";
			}
		}
	break;
	
// Fin Perfil Tecnico

// Genera perfil COMERCIAL

	case "html":
		if(trim($techno)=="4G"){
		?>
		<table border=1 width=100%>
			<tr>
				<td colspan=6 bgcolor="#CCCCCC">
					&nbsp;<b><?php echo $this->mainObj->translateWord('SUBS_INFO_TITLE');?></b>
				</td>
			</tr>
			<tr>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('HLR');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('MSISDN');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('IMSI');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('STATUS');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('AUTH');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('SERVICES');?></b>
				</td>
			</tr>
			<tr>
				<td align=center>
					<?php echo $res['trans']['HLR'];?>
				</td>
				<td align=center>
					<?php  echo $res['trans']['MSISDN'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['IMSI'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['STATUS'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['AUTH'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['SERVICES'];?>
				</td>
			</tr>
			<tr>
				<td colspan=6>
					&nbsp;
				</td>
			</tr>
			<tr>
				<td colspan=6 bgcolor="#CCCCCC">
					&nbsp;<b><?php echo $this->mainObj->translateWord('LOC_INFO_TITLE');?></b>
				</td>
			</tr>
			<tr>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('VOICEREGS');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('MSC');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('DATAREGS');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('COUNTRY');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('OPERATOR');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->tr<?php
$phone	= $_POST['searchstring'];
$view	= $_POST['searchtype'];
$techno	= $_POST['searchtechno'];

if(trim($techno)=="4G"){
	include_once("Vendors/HSS_Online/Classes/Request.php");
	include_once("Vendors/HSS_Online/Classes/Request_HSS.php");
	include_once("Vendors/HSS_Online/Classes/Parse_HSS.php");
	include_once("Vendors/HSS_Online/Classes/Translate_HSS.php");
	$ask	= new Request();
	$res	= $ask->Request_MSISDN($phone);
	if($res['trans']['MSISDN']==""){
		echo "<center>MSIDN no disponible en 4G</center>";
		exit;
	}
}else{
	include_once("Vendors/HLR_Online/Classes/Request.php");
	include_once("Vendors/HLR_Online/Classes/Request_HLR.php");
	$ask	= new Request();
	$res	= $ask->Request_MSISDN($phone,$view);
	if(($res['SUSCRIBER_IDENTITY']['MSISDN']=="")AND($view=="html")){
		echo "<center>MSIDN no disponible en 2G-3G</center>";
		exit;
	}
}
switch($view){
	case "xml":
		echo "<b>Comando SUB:</b><br><pre>";
		print htmlentities($res['orig']['SUB']);
		echo "</pre><b>Comando DYNSUB:</b><br><pre>";
		print htmlentities($res['orig']['DYNSUB']);
		echo "</pre><b>Comando CFALL:</b><br><pre>";
		print htmlentities($res['orig']['CFALL']);
		echo "</pre><b>Comando ECATEGORY:</b><br><pre>";
		print htmlentities($res['orig']['ECATEGORY']);
		echo "</pre><b>Comando CWAIT:</b><br><pre>";
		print htmlentities($res['orig']['CWAIT']);
		echo "</pre><b>Comando OPTGPRS:</b><br><pre>";
		print htmlentities($res['orig']['OPTGPRS']);
		echo "</pre>";
	break;

// Inicio perfil Tecnico

	case "array":
		if($techno=="4G"){

		//			echo "<pre>";
			//var_dump($res);
		//	echo "</pre>";
echo "<pre>";
$salida=array_slice($res,1);
print_r($salida);
//print implode(',',$res);
echo "</pre>";

		}else{
			foreach($res AS $line){

				echo $line."<br>"."\r\n";
			}
		}
	break;
	
// Fin Perfil Tecnico

// Genera perfil COMERCIAL

	case "html":
		if(trim($techno)=="4G"){
		?>
		<table border=1 width=100%>
			<tr>
				<td colspan=6 bgcolor="#CCCCCC">
					&nbsp;<b><?php echo $this->mainObj->translateWord('SUBS_INFO_TITLE');?></b>
				</td>
			</tr>
			<tr>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('HLR');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('MSISDN');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('IMSI');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('STATUS');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('AUTH');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('SERVICES');?></b>
				</td>
			</tr>
			<tr>
				<td align=center>
					<?php echo $res['trans']['HLR'];?>
				</td>
				<td align=center>
					<?php  echo $res['trans']['MSISDN'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['IMSI'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['STATUS'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['AUTH'];?>
				</td>
				<td align=center>
					<?php echo $res['trans']['SERVICES'];?>
				</td>
			</tr>
			<tr>
				<td colspan=6>
					&nbsp;
				</td>
			</tr>
			<tr>
				<td colspan=6 bgcolor="#CCCCCC">
					&nbsp;<b><?php echo $this->mainObj->translateWord('LOC_INFO_TITLE');?></b>
				</td>
			</tr>
			<tr>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('VOICEREGS');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('MSC');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('DATAREGS');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('COUNTRY');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->translateWord('OPERATOR');?></b>
				</td>
				<td align=center bgcolor="#EFEFEF">
					<b><?php echo $this->mainObj->tr